<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<script src="../lib/vue.min.js"></script>
</head>
<body>
    <div id="box">
      <button @click="handleClick()">click</button>
      <div v-if="isCreated">动态创建和删除--111111111111</div>
      <div v-else>动态创建和删除--2222222222</div>

      <ul v-if="datalist.length">
        <li v-for="data in datalist">
          {{data}}
        </li>
      </ul>

      <div v-else>
        购物车空空如也
      </div>


      <div v-if="which===1">
        111111
      </div>

      <div v-else-if="which===2">
        222222
      </div>

      <div v-else>
        333333
      </div>

      <template v-if="isCreated">

        <div >111111111111</div>
        <div >222222222222</div>
        <div >333333333333</div>
      </template>
    </div>

    <script type="text/javascript">
    	var vm = new Vue({
        el:"#box",
        data:{
          isCreated:false,
          datalist:[],
          which:1
        },
        methods: {
          handleClick(){
            this.isCreated = !this.isCreated
            this.datalist=["1111","2222","3333"]
          }
        },
      })
    </script>
</body>
</html>